import request from '@/utils/request'
export default{
    //1.课程列表
    addCourseInfo(courseInfo){
        return request({
            // url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
            url: `/eduservice/course/addCourseInfo`,
            method: 'post',
            data:courseInfo
          })
    },

    //2.查询所有讲师
    getListTeacher(){
      return request({
        url:'/eduservice/teacher/findAll',
        method:'get',
      })
    },
  //2.通过id查询讲师信息回显
  getCourseInfoById(courseId){
    return request({
      url:`/eduservice/course/getCourseInfoById/${courseId}`,
      method:'get',
    })
  },
  //修改课程信息
  updateCourseInfo(courseInfoVo){
      return request({
        url:`/eduservice/course/updateCourseInfo`,
        method:'post',
        data:courseInfoVo
      })
  },
  //课程确认信息显示
  getPublishCourseInfo(id){
      return request({
        url:`/eduservice/course/getPublishCourseInfo/${id}`,
        method:'get',
      })
  },
  //课程最终发布
  publishCourse(id){
    return request({
      url:`/eduservice/course/publishCourse/${id}`,
      method:'get',
    })
  },
  //课程列表
  getListCourse(){
    return request({
      url:`/eduservice/course/getCourseList`,
      method:'get',
    })
  },
  //1.课程列表（条件查询分页）
  //current:当前页,limit:每页记录数,teacherQuery:条件对象
  getCourseListPage(current,limit,courseQuery){
    return request({
      // url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
      url: `/eduservice/course/pageCourseCondition/${current}/${limit}`,
      method: 'post',
      //teacherQuery条件对象，后端使用requestBody获取数据
      data:courseQuery
    })
  },
  //删除课程信息
  deleteCourseById(courseId){
    return request({
      url:`/eduservice/course/removeCourseById/${courseId}`,
      method:'delete',
    })
  },
}
